home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_weap_seqcharge_m.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
7KB
|
262 lines
# Jedi Knight Missions Cog Script
#
# WEAP_SEQCHARGE_M.COG
#
# WEAPON 8 Script - Sequencer Charge
#
# Heartier than the Thermals and the DF IM Mines these are used by placing them on
# the ground or on walls. These have both delayed and proximity options.
#
# - Not affected by MagSealed sectors/surfaces.
#
# [YB & CYW] + [RF]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
model povModel=seqb.3do local
model povModel_m=seqb_m.3do local
model weaponMesh=seqg.3do local
# Animations that deal with bringing stuff up
keyframe mountAnim=SeqBmntr.key local
# Animations that deal with bringing stuff down
keyframe dismountAnim=SeqbDisr.key local
# Charge laying animations
keyframe povFireAnim=SeqBpstR.key local
keyframe povFire2Anim=SeqBpstR.key local
flex mountWait local
flex fireWait=0.8 local
flex holsterWait local
template projectile_tpl=+seqchrg local
template projectile_tpl2=+seqchrg2 local
template projectile_tpl3=+seqchrg3 local
template projectile_tpl4=+seqchrg4 local
template projectileB=+dudseqchrg local
keyframe holsterAnim=kyhlstr.key local
# The next 10 items actually function
# as an array of lain projectiles.
int projectile local
int iCounter local
material flashing=seq0mtp3.mat local
int cel local
int mode local
thing player local
int trackID=-1 local
int holsterTrack local
int selectMode=1 local
message startup
message activated
message deactivated
message selected
message deselected
message autoselect
message fire
message timer
end
# ========================================================================================
code
startup:
// Setup delays and variables.
mountWait = GetKeyLen(mountAnim);
// Start the material flashing.
MaterialAnim( flashing, 4, 1 );
Return;
# ........................................................................................
fire:
player = GetSourceRef();
mode = GetSenderRef();
// Check that the player is still alive.
if(GetThingHealth(player) <= 0)
{
Return;
}
SendMessageEx(GetThingClassCog(GetLocalPlayerThing()), user1, 3, 0, 0, 0);
if (GetInv(player, 93) > 0.0)
projectile = FireProjectile(player, projectileB, -1, 16, '0 0.05 0.00', '0 0 0', 1.0, 0, 0.0, 0.0);
else
projectile = FireProjectile(player, projectile_tpl[mode], -1, 16, '0 0.05 0.00', '0 0 0', 1.0, 0, 0.0, 0.0);
if (GetSenderID() == 2)
{
StopKey(player, holsterTrack, 0.0);
}
else
jkPlayPOVKey(player, povfireAnim, 1, 0x38);
ChangeInv(player, GetWeaponBin(8), -1.0);
// If out of ammo try to autoswitch to another weapon
// if autoswitch is enabled else just switch to fists.
if(GetInv(player, GetWeaponBin(8)) < 1)
{
// If the manual sequencer has no charges down and we are out of
// charges, do not allow it to be selected.
if (GetInv(player, GetWeaponBin(18)) == 1.0)
SetInv(player, GetWeaponBin(18), 0.0);
if(GetAutoSwitch() & 1)
{
SelectWeapon(player, GetWeaponBin(AutoSelectWeapon(player, 1)));
}
else
{
SelectWeapon(player, 1);
}
}
Return;
# ........................................................................................
activated:
player = GetSourceRef();
mode = GetSenderRef();
if (GetInv(player, 93) > 0.0)
SendMessageEx(GetThingClassCog(player), skill, 1100, 0, 0, 0);
if(mode > 1) Return;
jkSetWaggle(player, '0.0 0.0 0.0', 0);
ActivateWeapon( player, fireWait, mode );
Return;
# ........................................................................................
deactivated:
player = GetSourceRef();
mode = GetSenderRef();
jkSetWaggle(player, '10.0 7.0 0.0', 350);
DeactivateWeapon( player, mode );
Return;
# ........................................................................................
selected:
player = GetSourceRef();
jkPrintUNIString(player, 374); // "Automatic Mode"
PlayMode(player, 40);
if (GetInv(player, 67) == 0.0)
jkSetPOVModel(player, povModel); // Kyle hand
else
jkSetPOVModel(player, povModel_m); // Mara Hand
SetArmedMode(player, 0);
jkSetWeaponMesh(player, weaponMesh);
trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
jkSetWaggle(player, '10.0 7.0 0.0', 350);
SetMountWait(player, GetKeyLen(mountAnim));
jkClearFlags(player, 0x5);
SetCurWeapon(player, GetWeaponBin(8));
Return;
# ........................................................................................
deselected:
player = GetSourceRef();
jkPlayPOVKey(player, dismountAnim, 0, 18);
holsterWait = GetKeyLen(holsterAnim);
SetMountWait(player, holsterWait);
holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
SetTimerEx(holsterWait, 2, 0.0, 0.0);
if (trackID != -1)
{
jkStopPOVKey(player, trackID, 0);
trackID = -1;
}
jkSetWaggle(player, '0.0 0.0 0.0', 0);
Return;
# ........................................................................................
autoselect:
selectMode = GetSenderRef();
player = GetSourceRef();
// If the player has ammo
if(GetInv(player, GetWeaponBin(8)) != 0)
{
// query for ammo
if(selectMode == -1)
{
ReturnEx(300.0);
Return;
}
if((selectMode == 0) && !(GetAutoPickup() & 2))
{
ReturnEx(300.0);
Return;
}
if((selectMode == 1) && !(GetAutoSwitch() & 2))
{
ReturnEx(300.0);
Return;
}
if((selectMode == 2) && !(GetAutoPickup() & 2))
{
ReturnEx(300.0);
Return;
}
ReturnEx(-2.0);
Return;
}
else
{
ReturnEx(-1.0);
}
Return;
# ........................................................................................
timer:
if (GetSenderID() == 2)
{
StopKey(player, holsterTrack, 0.0);
}
Return;
end